//
// Created by fyt79 on 2019/6/9.
//


#ifndef SIGNAL_SOURCE_INCLUDE_H
#define SIGNAL_SOURCE_INCLUDE_H

#include <math.h>
#include <device/mmioutil.h>
#include <device/sbarmsoc_sb3500.h>
#include <device/sbdc_sb3500.h>
#include "../../utils/thread.h"
#include <stdint.h>

#define PI 3.1415926
#define FS 12288000
#define STEP 3000
#define SEND_BUFF 2048

//extern unsigned short i_send_buff[FS / STEP * 2];
//extern unsigned short q_send_buff[FS / STEP * 2];

extern short i_send_buff[2048];
extern short q_send_buff[2048];

extern short i_base_buff[2048];
extern short q_base_buff[2048];

short sin_table[FS / STEP];
short cos_table[FS / STEP];

void set_transmit_frequency(const char* frequency);

void transmit_init();

void* transmit_thread();

void* produce_5120x_idata_thread();
void* produce_5120x_qdata_thread();

void sbfirInterpolation_coeffs(short * coeff,short * coeff_rev,int phase);

void sbfirInterpolation_asm(short * in, short * coeff, short * out, int len, int phase);

#endif //SIGNAL_SOURCE_INCLUDE_H
